/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.bff.slimserver.musicjukebox.lib.actions;

import com.bff.slimserver.musicjukebox.lib.JukeboxProperties;
import com.bff.slimserver.musicjukebox.lib.events.PlayerChosenEvent;
import com.bff.slimserver.musicjukebox.lib.events.PlayerChosenListener;
import javax.swing.AbstractAction;
import org.bff.slimserver.SlimPlayer;

/**
 *
 * @author bill
 */
public abstract class PlayerAction extends AbstractAction implements PlayerChosenListener {

    private SlimPlayer player;

    public PlayerAction(SlimPlayer player) {
        this.player = player;
        JukeboxProperties.getInstance().addPlayerChosenListener(this);
    }

    @Override
    public void playerChosen(PlayerChosenEvent event) {
        this.player = event.getNewPlayer();
    }

    /**
     * @return the player
     */
    public SlimPlayer getPlayer() {
        return player;
    }
}